package com.ningkang.ums.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * @ClassName：UmsHandler
 * @Author: LeiHao
 * @Date: 2024/10/18 11:29
 * @Description: 用户信息模块字段自动填充
 */
@Component
public class UmsHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("createTime", LocalDateTime.now(),metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
//        this.setFieldValByName("modifyTime",new Date(),metaObject);
    }



}
